3.154 \(\int \csc ^2(e+f x) (a+b \sin (e+f x)) \, dx\)

Optimal. Leaf size=26 \[ -\frac{a \cot (e+f x)}{f}-\frac{b \tanh ^{-1}(\cos (e+f x))}{f} \]

[Out]

-((b*ArcTanh[Cos[e + f*x]])/f) - (a*Cot[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0370161, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {2748, 3767, 8, 3770} \[ -\frac{a \cot (e+f x)}{f}-\frac{b \tanh ^{-1}(\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^2*(a + b*Sin[e + f*x]),x]

[Out]

-((b*ArcTanh[Cos[e + f*x]])/f) - (a*Cot[e + f*x])/f

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \csc ^2(e+f x) (a+b \sin (e+f x)) \, dx &=a \int \csc ^2(e+f x) \, dx+b \int \csc (e+f x) \, dx\\ &=-\frac{b \tanh ^{-1}(\cos (e+f x))}{f}-\frac{a \operatorname{Subst}(\int 1 \, dx,x,\cot (e+f x))}{f}\\ &=-\frac{b \tanh ^{-1}(\cos (e+f x))}{f}-\frac{a \cot (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0244442, size = 52, normalized size = 2. \[ -\frac{a \cot (e+f x)}{f}+\frac{b \log \left (\sin \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{f}-\frac{b \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^2*(a + b*Sin[e + f*x]),x]

[Out]

-((a*Cot[e + f*x])/f) - (b*Log[Cos[e/2 + (f*x)/2]])/f + (b*Log[Sin[e/2 + (f*x)/2]])/f

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 35, normalized size = 1.4 \begin{align*}{\frac{b\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}-{\frac{\cot \left ( fx+e \right ) a}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^2*(a+b*sin(f*x+e)),x)

[Out]

1/f*b*ln(csc(f*x+e)-cot(f*x+e))-a*cot(f*x+e)/f

________________________________________________________________________________________

Maxima [A]  time = 1.76716, size = 54, normalized size = 2.08 \begin{align*} -\frac{b{\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + \frac{2 \, a}{\tan \left (f x + e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(b*(log(cos(f*x + e) + 1) - log(cos(f*x + e) - 1)) + 2*a/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [B]  time = 1.59715, size = 180, normalized size = 6.92 \begin{align*} -\frac{b \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) \sin \left (f x + e\right ) - b \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) \sin \left (f x + e\right ) + 2 \, a \cos \left (f x + e\right )}{2 \, f \sin \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

-1/2*(b*log(1/2*cos(f*x + e) + 1/2)*sin(f*x + e) - b*log(-1/2*cos(f*x + e) + 1/2)*sin(f*x + e) + 2*a*cos(f*x +
 e))/(f*sin(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (e + f x \right )}\right ) \csc ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**2*(a+b*sin(f*x+e)),x)

[Out]

Integral((a + b*sin(e + f*x))*csc(e + f*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 2.18197, size = 84, normalized size = 3.23 \begin{align*} \frac{2 \, b \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) \right |}\right ) + a \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - \frac{2 \, b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + a}{\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*(2*b*log(abs(tan(1/2*f*x + 1/2*e))) + a*tan(1/2*f*x + 1/2*e) - (2*b*tan(1/2*f*x + 1/2*e) + a)/tan(1/2*f*x
+ 1/2*e))/f